 export function formatTimeDiff(timestamp) {
    const currentTime = new Date();
    const targetTime = new Date(timestamp);
    const diff = currentTime - targetTime;

    const oneMinute = 60 * 1000;
    const oneHour = 60 * oneMinute;
    const oneDay = 24 * oneHour;
    const sevenDays = 7 * oneDay;

    if (diff < oneMinute) {
        return "一分钟";
    } else if (diff < oneHour) {
        const minutes = Math.floor(diff / oneMinute);
        return `${minutes}分钟`;
    } else if (diff < oneDay) {
        const hours = Math.floor(diff / oneHour);
        return `${hours}小时`;
    } else if (diff < sevenDays) {
        const days = Math.floor(diff / oneDay);
        return `${days}天`;
    } else {
        return "7天";
    }
}

